{layout name="passport:login:layout" /}
<div class="login_wrap">
  <div class="title"><a href="//{$web.url}"><img src="__PUBLIC__/manage/managerlogo.png" /></a></div>
  <form id="form" action="{:url('system/passport.login/index')}">
    <input type="hidden" name="__token__" value="{$Request.token}" />
    <div class="row fn-clear"><input datatype="m" class="input" type="text" name="login_id" placeholder="您的手机号" x-webkit-speech /></div>
    <div class="row fn-clear"><input datatype="*" class="input" type="password" name="login_password" placeholder="登录密码" autocomplete="off" /></div>
    <div class="row fn-clear captcha">
        <div class="fn-left"><input autocomplete="off" datatype="*" class="input" type="text" name="captcha" placeholder="验证码" /></div>
        <div class="fn-left"><img id="captcha"  src="{:captcha_src()}" alt="captcha" onclick="reimg()"/></div>
    </div>
    <div class="row"><button class="btn" type="submit">登 录</button></div>
  </form>
  <div class="bottom">
    <a href="{:url('system/passport.login/getpassword')}" class="button"><i class="iconfont icon-xiugaidenglumima"></i> 找回密码</a>
    <a href="{:url('system/passport.login/reg')}" class="button button-green"><i class="iconfont icon-add_icon"></i> 创建账户</a>
  </div>
</div>
<script type = "text/javascript" >
  Do('layer','form',function(){
    $("#form").Validform({
        btnSubmit:".btn",ajaxPost:true,tiptype:function(){},postonce:true,callback:function(data){
          if(data.code == 200){
              window.location.href = data.url;
          }else{
              layer.alert(data.message,{icon:5},function(index){
                layer.close(index);
                location.reload();
              });
          }}
    });
  })
  //刷新验证码
  function reimg(){
    var img = document.getElementById("captcha");
    img.src = "{:captcha_src()}?rnd=" + Math.random();
  }
</script>